package com.ruoyi.business.component.mqconsumer.repaymentconsumers;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.bizsys.domain.ExtMonnifyOrder;
import com.ruoyi.bizsys.service.IExtMonnifyOrderService;
import com.ruoyi.bizsys.utils.BizConstants;
import com.ruoyi.business.service.IMonnifyRepaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Monnify轮询的mq的处理类
 * @author wqg
 * @description
 * @date 2022/5/21
 */
@Slf4j
@Service(BizConstants.ROCKMQ_REPAYMENT_TYPE_MONNIFY_LUNXUN)
public class MonnifyLunxunConsumer implements IRepaymentMqService{

    @Autowired
    IMonnifyRepaymentService monnifyRepaymentService;

    @Autowired
    IExtMonnifyOrderService iExtMonnifyOrderService;
    /**
     * @param msgObj
     */
    @Override
    public void handle(JSONObject msgObj) {
        log.info("monnify 轮询的处理类start：data:{}", msgObj.toString());
        ExtMonnifyOrder extMonnifyOrder =  msgObj.getObject("extMonnifyOrder",ExtMonnifyOrder.class);
        monnifyRepaymentService.repaymentLock(extMonnifyOrder);
        log.info("monnify 轮询的处理类end：data:{}",msgObj);
    }
}
